program HalfSwap;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement = ^element;
  element = record
    value: integer;
    next: pelement;
  end;

procedure AddToBeg (var head: pelement; num: integer);
var tmp: pelement;
begin
  tmp:=head;
  new (head);
  head^.next:=tmp;
  head^.value:=num;
end;

procedure AddtoEnd (var head: pelement; num: integer);
var cur: pelement;
begin
  if (head<>nil) then
  begin
    cur:=head;
    while (cur^.next <> nil) do
      cur:=cur^.next;
    new (cur^.next);
    cur^.next^.value:=num;
    cur^.next^.next:=nil;
    end else
      AddToBeg (head, num);

end;

procedure PrintList (head: pelement);
var cur: pelement;
begin
  cur:=head;
  while (cur<>nil) do
  begin
    writeln (cur^.value);
    cur:=cur^.next;
  end;
end;

var
  fin: textfile;
  n, i, t, k: integer;
  head, head0, t1: pelement;
begin
  head:=nil;
  head0:=nil;
  Assignfile (fin, 'input.txt');
  Reset (fin);
  Readln (fin, n);
  for i:= 1 to n do
  begin
    Read (fin, t);
    AddtoEnd (head0, t);
  end;
  k:=(n div 2);
  for i:= 1 to k do
  begin
    AddToEnd (t1, head0^.value);
    head0:=head0^.next;
  end;
  for i:= 1 to n-k do
  begin
    AddToEnd (head, head0^.value);
    head0:=head0^.next;
  end;
  for i:= 1 to k do
  begin
    AddToEnd (head, t1^.value);
    t1:=t1^.next;
  end;
  PrintList (head);
  readln;
end.

